#ifndef __H_GAME_H__
#define __H_GAME_H__

#include <tuple>
#include <deque>
#include <vector>
#include <map>
#include <queue>
#include <functional>
#include <mutex>
#include <thread>
#include <atomic>
#include "ICC_Timer_Handler.h"
#include "RedisClient.h"
#include "GameBase.h"
#include "CClient.h"
#include "log.h"
#include "HostBase.h"
#include "HttpServer.h"
#include "CurlClient.h"

class CHost;
class CGameServer :public BYTimerOject
{
public:
	CGameServer();
	virtual ~CGameServer();
public:
	// callback && interface
	virtual bool InitGame();
	virtual int OnBYTimeOut(int Timerid);
	int ProcessPacket(SocketHandler* pHandler, NETInputPacket* inputPkg);
	int ProcEventBackConn(int ev_id, SpiderEvent* pEvent);
	int ProcHttp(std::uint32_t request_id, stHttpRequest&& http_req);
	int ResponseHttp(std::uint32_t request_id, stHttpResponse&& http_resp);

public:
    // void HandlePress();
	void PostMessage(const std::string& url, int index, int times, int max_times);
	void OnPostResponse(std::uint64_t transid, int err, stHttpResponse&& response);

public:
	CHost* m_pHost;
	HttpServer m_http_server;
	CurlClient m_curl_client;
};




#endif


